package com.rapida.framwork;

import java.util.HashSet;
import java.util.Iterator;

public class Slot {
	private HashSet<Signal> m_senders = new HashSet<Signal>();

	public void signal_connect(Signal signal) {
		m_senders.add(signal);
	}

	public void signal_disconnect(Signal signal) {
		m_senders.remove(signal);
	}

	public void disconnect_all() {
		Iterator<Signal> iter = m_senders.iterator();
		while (iter.hasNext()) {
			Signal key = (Signal) iter.next();
			key.disconnect(this);
		}
		m_senders.clear();
	}
}
